From e5ecef6f879fe3e5cd039f209cb26a4bd263d443 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 16 Apr 2026 18:38:22 +0200 Subject: [PATCH] mpris: Do not send player-removed for a player that has never been added We only emit player-added for players that can play, but we remove them all, despite this state. This causes a non-fatal warning during the removal of a non-existent notification (that is in fact an undefined message) Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/8284 Part-of: --- js/ui/mpris.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/ui/mpris.js b/js/ui/mpris.js index 44efbd64e..55231551f 100644 --- a/js/ui/mpris.js +++ b/js/ui/mpris.js @@ -244,7 +244,11 @@ export const MprisSource = GObject.registerClass({ if (player) { this._players.delete(name); player.disconnectObject(this); - this.emit('player-removed', player); + + // if !canPlay, the player has already been removed + // or was never exposed in our public players list + if (player.canPlay) + this.emit('player-removed', player); } } -- 2.39.5